package com.edu.chapter07.adapter;

import android.content.Context;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter4.BaseQuickAdapter;
import com.chad.library.adapter4.viewholder.QuickViewHolder;
import com.edu.chapter07.R;
import com.edu.chapter07.bean.ItemBean;

public class WaterfallAdapter extends BaseQuickAdapter<ItemBean, QuickViewHolder> {

    @Override
    protected void onBindViewHolder(@NonNull QuickViewHolder quickViewHolder, int i, @Nullable ItemBean itemBean) {
        if (itemBean != null) {
            quickViewHolder.setText(R.id.tv_title, itemBean.getTitle());
        }
    }

    @NonNull
    @Override
    protected QuickViewHolder onCreateViewHolder(@NonNull Context context, @NonNull ViewGroup viewGroup, int i) {
        return new QuickViewHolder(R.layout.waterfall_item, viewGroup);
    }
}